# simpleNetwork
# Copyright (c) 2025 charlieshu <https://gitee.com/charlieshu>
# Released under the MIT License.
# See LICENSE file for full text.

import simpleNetwork as sn

ip = "127.0.0.1"
port = int(input("Port: "))

sn.setListenPort(port)

while True:
    user = input(">")
    if(user.startswith("/connect")):
        sn.connect(ip, int(user.split(" ")[1]))
    elif(user.startswith("/send")):
        sn.sendMessage(ip, int(user.split(" ")[1]), user.split(" ")[2])
    elif(user.startswith("/get")):
        for ms in sn.getMessage():
            print(ms)
